﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net.Sockets;

namespace LockCrypt.Firefox {
    /// <summary>
    /// A container used for receiving a response.
    /// </summary>
    public class RequestBuffer {
        /// <summary>
        /// Gets or sets the temporary buffer used to read each section of a response.
        /// </summary>
        /// <value>The buffer.</value>
        public byte[] Buffer { get; set; }

        /// <summary>
        /// Gets or sets the buffer of request data received so far.
        /// </summary>
        /// <value>The buffer of request data received so far.</value>
        public StringBuilder RequestBuilder { get; set; }

        /// <summary>
        /// Gets or sets the index of the character which was last parsed.
        /// </summary>
        /// <value>The index of the character which was last parsed.</value>
        public int Position { get; set; }

        public bool ReceiveFinished { get; set; }

        /// <summary>
        /// Initializes a new <see cref="RequestBuffer"/>.
        /// </summary>
        public RequestBuffer() {
            Buffer = new byte[1024];
            RequestBuilder = new StringBuilder();
            Position = 0;
        }
    }
}
